<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--CDN引入方式-->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>

<div id="app">
    <!--v-if条件判断指令-->
    <h1>{{msg}}</h1>
    <h2 v-if="sign" v-bind:style="ys">{{t}}</h2>
    <h2 v-if="sign_f" v-bind:style="ys">{{f}}</h2>
</div>

</body>

<script type="application/javascript">
    // 创建Vue对象
    var vm = new Vue({
        el: "#app",
        data: {
            msg: "Hello Vue!",
            sign: true,
            sign_f: false,
            ys: "color: red;",
            t: "条件为true",
            f: "条件为false"
        }
    });
</script>

</html>